/**
 * 
 */
package view;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import common.DataManager;
import controller.Controller;

/**
 * This is an image that also implements MouseListener so it can respond to the user's mouse click events.
 * This "button" is used to allow the user to commit suicide in the game.
 *
 */
public class SuicideButton extends ImagePanel implements MouseListener{

	public SuicideButton(){
		super(DataManager.SUICIDE_BUTTON);
		addMouseListener(this);
	}

	@Override
	public void mouseClicked(MouseEvent arg0) {
		Controller.killPlayer();
	}

	@Override
	public void mouseEntered(MouseEvent arg0) {
		Controller.pauseGame();
		Controller.displayMessage("<html> Are you sure you want to self destruct?<br><br>It will cause you to lose all your current weapons and <br>return to the main menu!");
	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		Controller.pauseGame();
		Controller.removeMessage();
		
	}

	@Override
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
}
